/**
 * app
 * @author MrZhong [ 799149346@qq.com / http://github.com/Mr-ZhongWeiWei ]
 * @date 2021/12/9
 */
import { createSlice } from "@reduxjs/toolkit"
import storage from "store";
import {DEFAULT_COLOR, DEFAULT_LAYOUT_MODE, DEFAULT_THEME} from "../mutation-types";

export const app = createSlice({
    name:'app',
    initialState:{
        sidebarCollapsed: false,
        settingPanelVisible: false,
    },
    reducers: {
		
		export const toggleSiderBar = () => {
		  return {
		    type: types.APP_TOGGLE_SIDEBAR
		  };
		};
		
		export const toggleSettingPanel = () => {
		  return {
		    type: types.APP_TOGGLE_SETTINGPANEL
		  };
		};
		
		
		
        toggleSiderBar: (state,{ payload })=>{
            state.collapsed = payload
        },
		toggleSettingPanel: (state,{ payload })=>{
		    state.collapsed = payload
		},
    }
})

export const { toggleSiderBar, toggleSettingPanel } = app.actions

export default app.reducer
